#!/usr/bin/python

import sys
import matplotlib.pyplot as plt
import pylab
import random

filename = sys.argv[1]
f = open(filename, "rU")
fl = f.readlines()

x1 = []
x2 = []
y1 = []
y2 = []

for i, line in enumerate(fl):
    l = line.split('\t')
    start = int(l[0])
    stop = int(l[1].rstrip())
    x1.append(start)
    x2.append(stop)
    #number = random.randrange(5, 10)
    number = random.uniform(5, 15)
    y1.append(number)
    y2.append(number)

gx = [1,4721396]
gy = [1,1]

y1.sort()
y2.sort()

a = [x1, x2]
b = [y1, y2]

fig = plt.figure(1, figsize=(14,6))

plt.plot(gx, gy, color='blue', marker='|', markersize=8.0,
    markeredgecolor='black', linestyle='-', linewidth=2.0)
#plt.plot(x, y, 'g>') 
plt.plot(a, b, color='orange', linestyle='-')
plt.axis([-1000, 4722698, 0, 20])
plt.title('Paired-end clones')
plt.xlabel('Genome coordinates(bp)')
plt.ylabel('tiled clone pairs')

frame1 = plt.gca()
for tick in frame1.axes.get_yticklines():
    tick.set_visible(False)
for y in frame1.axes.get_yticklabels():
    y.set_visible(False)

plt.grid(True)

plt.show()

